import { useModel } from '@@/plugin-model/useModel';
import styles from './_layout.less';
import { NavBar } from 'antd-mobile';

export default (props: any) => {
  const { config } = useModel('config');

  const goBack = () => {
    props.history.goBack();
  };

  return (
    <div className={styles.app}>
      <NavBar
        onBack={goBack}
        style={{
          '--border-bottom': '1px #eee solid',
        }}
      >
        {config?.title}
      </NavBar>
      <div className={styles.body} id="geminis-app-container">
        {props.children}
      </div>
    </div>
  );
};
